﻿#ifndef ADCLIENT_H
#define ADCLIENT_H

#include <QMainWindow>
#include "addate.h"
#include "adsocket.h"
#include "weather.h"
#include "rollmassege.h"
#include <QLabel>
#include <QProgressDialog>
#include "stdlib.h"
#include <QThread>
#include <QTimer>
#include <QFile>
#include <QMessageBox>
#include <QNetworkInterface>
#include <QTcpSocket>
#include <QHostAddress>
#include <QAbstractSocket>
#include <QLineEdit>
#include <QPushButton>

namespace Ui {
class AdClient;
}

class AdClient : public QMainWindow
{
    Q_OBJECT

public:
    explicit AdClient(QWidget *parent = 0);
    ~AdClient();
    void saveFile();// 保存文件
    void InitStatusBar();// 初始化底部状态栏
    QString GetLocalIP();// 获取本地IP

public slots:
    void showImage(QImage);// 图片显示
    void showProgressBar(int currentProgress,int finish);//进度条显示
    void autoPlayTimeOut();//自动播放
    void GUI_WarningMsg(QString title,QString text,QString buttons,QString defaultButton);//设置警报
private:
    Ui::AdClient *ui;
    AdDate *date;
    AdSocket *socket;
    Weather *weater;
    RollMassege *rollmsg;
    QProgressDialog *progress;// 创建进度条
    QTimer autoPlayTimer;
    int index;
    QLabel *mLocalIP;
    QLabel *serverIP_lb;
    QLineEdit *serverIP;
    QLabel *serverPort_lb;
    QLineEdit *serverPort;
    QPushButton *connectTcp;

};

#endif // ADCLIENT_H
